<tagLib name="html" />
{$header}<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
  
  <php>
    $str = __SELF__;
    $pattern = "/\&keywords(.*)+/";
    $post_url = preg_replace($pattern, "\$1", $str);
  </php>  
<!--  功能组区域  -->
<div class="btn-toolbar">
  <button class="btn"> 选择供应商</button>
          <form class="search-form pull-right" method='post' action="{$post_url}">
              <input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
                    <php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php><else/>
                    placeholder="搜索"
                </notempty>
                >
                <input type="submit" class="btn btn-primary" value="搜索">
          </form>
  </div>
<!-- 功能组区域结束 -->
<php>
    function getCateName($cat_id=0){
        return getModelName($cat_id,'Category');
    }
    function getMan($sid){
      $cid = getModelName($sid,'Supplier','contact_id');
        return getModelName($cid,'Contact','name');
    }
    function getPhone($sid){
      $cid = getModelName($sid,'Supplier','phone');
        return $cid;
    }
    function getFax($sid){
      $cid = getModelName($sid,'Supplier','fax');
        return $cid;
    }

</php>
<!-- 列表显示区域  -->
<div class="list" >
<div id="result" class="result none"></div>
<table class="table table-bordered table-striped" id="checkList">
<tr>
  <th width="5%"><a href="javascript:sortBy('id','1','search',".urldecode($_REQUEST['keywords'])."'" title="按照编号升序排列 ">编号</a>
  </th>
  <th>产品</th>
  <th>
    <a href="javascript:sortBy('name','1','search',".urldecode($_REQUEST['keywords'].")" title="按照名称升序排列 ">供应商</a>
  </th>
  <th>
    <a href="javascript:sortBy('ename','1','search','')" >规格</a>
  </th>
  <th>
    <a href="javascript:sortBy('cas','1','search','')">报价</a>
  </th>
  <th>
    <a href="javascript:sortBy('cas','1','search','')">业务报价参考意见</a>
  </th>
  <th>
    <a href="javascript:sortBy('formula','1','search','')" title="按照类别升序排列 ">创建时间</a>
  </th>
  <th>
    <a href="javascript:sortBy('weight','1','search','')" title="按照单位升序排列 ">更新时间</a>
  </th>
  <th>
    <a href="javascript:sortBy('nature','1','search','')" title="按照默认进价升序排列 ">联系人</a>
  </th>
  <th>电话</th>
  <th>传真</th>
  <th>询价等级</th>
  <th>询价负责人</th>
  <th width="8">
    选择</th>
</tr>
<volist name="list" id="vo">
  <tr>
    <td>{$vo.id}</td>
    <td>{$vo.pname}</td>
    <td>{$vo.supplier_id|getModelName='Supplier'}</td>
    <td>{$vo.specification}</td>
    <td>{$vo.offer}</td>
    <td>{$vo.sale_consult|getConfigVal="sale_consult"}</td>
    <td>{$vo.create_time|toDate}</td>
    <td>{$vo.update_time|toDate}</td>
    <td>{$vo.supplier_id|getMan}</td>
    <td>{$vo.phone}</td>
    <td>{$vo.fax}</td>
    <td>{$vo.status|getConfigVal='askrank'}</td>
    <td>{$vo.ask_supplier_id|getModelName='Ask_supplier','charge_man'|getModelName='User'}</td>
    <td><input type="checkbox" value='{$vo.supplier_id}' onclick="selectpro('{$vo.supplier_id}','{$vo.sname}',{$vo.ask_supplier_id|getModelName='Ask_supplier','charge_man'})"></td>
  </tr>
</volist>
</table>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>

<!-- 主页面结束 -->
<include file="Public:footer"/>
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" language="javascript">
//选择最佳供应商，返回到采购详情中
  function selectpro(id,name,ask_charge_man){
      window.opener.document.form1.cq.value = name;
      window.opener.document.form1.supplier_id.value = id;
      window.opener.document.form1.ask_charge_man.value = ask_charge_man;
      window.close(); 
      return false;
}
 

</script>
